﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Bussiness;

namespace EWebsite
{
    public partial class Site : System.Web.UI.MasterPage
    {
        private DataTable _tblCategories;
        String catTree = "";

        public String CatTree {
            get { return catTree; }
            set { catTree = value; }
        }
        protected DataTable TblCategories {
            get { return _tblCategories; }
            set { _tblCategories = value; }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack) {
                //load categories
                CategoryBuss catBussiness = new CategoryBuss();
                _tblCategories = catBussiness.getCategories();

                Helper helper = new Helper();
                DataTable tbl = _tblCategories;
                helper.createCategoryTree(ref tbl, 0, 0, ref catTree);
            //}
        }

    }
}